<% if @my_deliveries.length > 0 %> 
<table cellspacing="10">
  <tr>
    <th>Restaurant</th>
    <th>Bounty</th>
    <th>Cost</th>
    <th>Destination</th>
    <th>Content</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @my_deliveries.each do |order| %>
  <tr>
    <td><%= order.restaurant %></td>
    <td><%= number_to_currency(order.bounty) %></td>
    <td><%= number_to_currency(order.order_cost) %></td>
    <td><%= order.order_destination %></td>
    <td><%= truncate order.content, :length => 25 %></td>
    <td><%= link_to 'Show', order %></td>
    <% if order.delivery_completed %>
    <td>Delivery Completed</td>
    <% else %>
    <td><%= link_to 'Report Completed', completed_url(:id => order.id), :confirm => "Are you sure?" %></td>
    <% end %>
    <% if order.customer_feedback.length == 0 && (order.delivery_failed || order.delivery_completed) %>
    <td><%= link_to 'Leave Feedback', :controller => "orders", :action => "customer_feedback", :id => order.id %></td>
    <% elsif order.delivery_completed || order.delivery_failed %>
    <td><%= order.driver_feedback %></td>
    <% else %>
    <td></td>
    <% end %>
  </tr>
<% end %>
</table>
<% else %>
None yet.
<% end %>

